<?php
namespace app\common\model;




class Check extends Base
{

    public function getStatusTextAttr($value,$data)
    {
        $status = [1=>'通过', 2=>'待审核',  0=>'已回退'];
        return $status[$data['status']];
    }


    public function getList($map = []){
        return $this->alias('a')
            ->join('users u','u.user_id = a.user_id','LEFT')
            ->where($map)
            ->order('create_time desc')
            ->field('a.*,u.user_id,u.nick_name')
            ->paginate('',false,['query'=>request()->param()]);
    }

    public function getBanner($map = [],$limit = 6)
    {
        return $this->where($map)->field('bid,url,title,img')->order('order')->limit($limit)->select();
    }


}